public class DeletingMiddleNode{
  public void deleteMiddleNode(Node middle) {
    if( middle == null || middle.next == null ){
      middle = null;
      return;
    }
      
    else {
      middle.data = middle.next.data;
      middle.next = middle.next.next;
    }
  }
}